ggplot (continued)

Bar plots

## 
##   4   f   r 
## 103 106  25

### Using Colors

  1. Aesthetics
  1. Colors that are attractive - large geoms (fills) - pale colors - small geoms(lines,points) - bright colors
  2. Colors that highlight elements - pale, grey to de-emphasize - bright or saturated colors to emphasize
  3. Colors that are visible to the color blind
  4. Colors that convert well to black and white
  1. Information content
  1. Discrete scale
  • colors to group similar treatments
  • neutral colors (black,grey,white) to indicate control groups
  • Symbolic colors (heat=red, cool = blue, photosynthesis/growth=green, oligotrophic=blue, eutrophic=brown, infected=red)
  • Colors that map to chemical stains or gels, or even colors of organisms
  1. Continuous scale
  • monochromatic (differing shades of 1 color)
  • 2 tone chromatic scale (from color x to color y)
  • 3 tone divergent scale (from color x through color y to color z)
  1. Use color information within and between graphs
  1. show color names, hex in base R
  2. show color schemes in colorbrewer

using alpha transparency for histograms

## 'data.frame':    200 obs. of  2 variables:
##  $ v1 : num  -0.0306 1.4022 0.166 2.5987 -1.1781 ...
##  $ lab: Factor w/ 2 levels "Control","Treatment": 1 1 1 1 1 1 1 1 1 1 ...

Tour of color palettes

Wes Anderson palettes
## $BottleRocket1
## [1] "#A42820" "#5F5647" "#9B110E" "#3F5151"
## [5] "#4E2A1E" "#550307" "#0C1707"
## 
## $BottleRocket2
## [1] "#FAD510" "#CB2314" "#273046" "#354823"
## [5] "#1E1E1E"
## 
## $Rushmore1
## [1] "#E1BD6D" "#EABE94" "#0B775E" "#35274A"
## [5] "#F2300F"
## 
## $Rushmore
## [1] "#E1BD6D" "#EABE94" "#0B775E" "#35274A"
## [5] "#F2300F"
## 
## $Royal1
## [1] "#899DA4" "#C93312" "#FAEFD1" "#DC863B"
## 
## $Royal2
## [1] "#9A8822" "#F5CDB4" "#F8AFA8" "#FDDDA0"
## [5] "#74A089"
## 
## $Zissou1
## [1] "#3B9AB2" "#78B7C5" "#EBCC2A" "#E1AF00"
## [5] "#F21A00"
## 
## $Darjeeling1
## [1] "#FF0000" "#00A08A" "#F2AD00" "#F98400"
## [5] "#5BBCD6"
## 
## $Darjeeling2
## [1] "#ECCBAE" "#046C9A" "#D69C4E" "#ABDDDE"
## [5] "#000000"
## 
## $Chevalier1
## [1] "#446455" "#FDD262" "#D3DDDC" "#C7B19C"
## 
## $FantasticFox1
## [1] "#DD8D29" "#E2D200" "#46ACC8" "#E58601"
## [5] "#B40F20"
## 
## $Moonrise1
## [1] "#F3DF6C" "#CEAB07" "#D5D5D3" "#24281A"
## 
## $Moonrise2
## [1] "#798E87" "#C27D38" "#CCC591" "#29211F"
## 
## $Moonrise3
## [1] "#85D4E3" "#F4B5BD" "#9C964A" "#CDC08C"
## [5] "#FAD77B"
## 
## $Cavalcanti1
## [1] "#D8B70A" "#02401B" "#A2A475" "#81A88D"
## [5] "#972D15"
## 
## $GrandBudapest1
## [1] "#F1BB7B" "#FD6467" "#5B1A18" "#D67236"
## 
## $GrandBudapest2
## [1] "#E6A0C4" "#C6CDF7" "#D8A499" "#7294D4"
## 
## $IsleofDogs1
## [1] "#9986A5" "#79402E" "#CCBA72" "#0F0D0E"
## [5] "#D9D0D3" "#8D8680"
## 
## $IsleofDogs2
## [1] "#EAD3BF" "#AA9486" "#B6854D" "#39312F"
## [5] "#1C1718"